package com.kuizii.demo.core.data.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kuizii.demo.core.dao.SysUserDao;
import com.kuizii.demo.core.data.service.SysUserDataService;
import com.kuizii.demo.core.domain.entity.user.SysUserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.Map;



/**
 * <p>
 *  如果小型项目，业务不复杂 ,dataService层可直接作服务提供者（实现服务接口）暴露服务
 * <p/>
 *
 * @author nuanyang
 * Email freexiaodong@163.com
 * Created by 2019-06-15 16:46:32
 */
@Service
public class SysUserDataServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> implements SysUserDataService {

    @Autowired
    private SysUserDao userMapper;

    public Page<Map<Object, Object>> selectUserPage(Page page, String search) {

        page.setRecords(baseMapper.selectUserList(page, search));
        return page;
    }


    @Override
    public void updateUser(SysUserEntity sysUser, String[] roleId) {

    }

    @Override
    @Async("taskExecutor")
    public String testAsync() {
        try {
            Thread.sleep(10 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "ok";
    }

    @Override
    public void delete(String id) {

    }



}
